package com.example.demo1.wyy.dao;

import com.example.demo1.wyy.model.Plant;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PlantMapper {
    List<Plant> queryAll();
    @Select("select * from plant where id = #{id}")
    List<Plant> queryById(Integer id);

    int savePlant(Plant plant);

    /*@SelectProvider(type = DynamicJoin.class, method = "queryUserByIds")
    List<User> queryByUserIds(@Param("userIds") long... userIds);*/

    /*public String queryUserByIds(@Param("userIds") long[] userIds) {
        return new SQL() {{
            SELECT(" u.Id, u.UserName, u.personName, u.email, u.telephone, u.PersonName, u.Enabled,u.StaffType ");
            FROM(" SC_Users u ");
            StringBuffer userPlaceHolder = new StringBuffer();
            for (long userId : userIds) {
                userPlaceHolder.append(userId + ",");
            }
            userPlaceHolder.setLength(Math.max(userPlaceHolder.length() - 1, 0));
            WHERE("u.Id in (" + userPlaceHolder + ")");
        }}.toString();
    }*/
}
